package org.petstore.persistence;

import org.petstore.domain.Order;

import java.util.List;

public interface OrderDAO {
    /**
     * description 通过username获取该用户的所有订单
     *
     * @param username:
     * @return List<Order>
     * @author huangzhangyan
     * @date 2021/11/1 0:40
     */
    List<Order> getOrdersByUsername(String username);

    /**
     * description 通过orderID获取order
     *
     * @param orderId:
     * @return Order
     * @author huangzhangyan
     * @date 2021/11/1 0:40
     */
    Order getOrderByOrderId(int orderId);

    /**
     * description 插入一个新的订单,在orders表中
     *
     * @param order:
     * @author huangzhangyan
     * @date 2021/11/1 0:44
     */
    void insertOrder(Order order);

    /**
     * description 插入一个新的订单状态,在orderstatus表中
     *
     * @param order:
     * @author huangzhangyan
     * @date 2021/11/1 0:44
     */
    void insertOrderStatus(Order order);
}
